/*
 * @Description: 
 * @Author: liuzl
 * @Date: 2024-09-29 16:33:10
 * @LastEditors: liuzl
 * @LastEditTime: 2024-09-29 16:42:49
 */

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * Test03ArrayList
 */
public class Test03ArrayList {

    public static void main(String[] args) {
        List<String> list = new ArrayList<>(); 
        list.add("apple");
        list.add("banana");
        list.add("orange");
        list.add("apple");
        System.out.println(list);
        Set<String> set = new HashSet<>(list);
        list.clear();
        list.addAll(set);
        System.out.println("new:"+set);
    }
}